package com.zb.controller;

import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/user")
public class UserController {
    @GetMapping("/list")
    public List<Map<String, String>> list(@RequestParam("name") String name) {
        System.out.println("=========" + name);
        Map<String, String> map1 = new HashMap<>();
        map1.put("username", "zhangsan");
        map1.put("age", "20");
        Map<String, String> map2 = new HashMap<>();
        map2.put("username", "lisi");
        map2.put("age", "20");
        Map<String, String> map3 = new HashMap<>();
        map3.put("username", "wangwu");
        map3.put("age", "20");
        List<Map<String, String>> list = new ArrayList<>();
        list.add(map1);
        list.add(map2);
        list.add(map3);
        return list;
    }

}
